package org.grow.loginto.entity.enums;

import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import java.util.stream.Collectors;

public enum AuditState{
    notAudit("未审核"),auditFailed("审核失败"),
    auditSucceed("审核成功");
    private String text;

    AuditState(String text) {
        this.text = text;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public static List<Map<String,Object>> auditFullStates(){
        return Arrays.stream(AuditState.values())
                .map(x -> {
                    TreeMap<String, Object> obj = new TreeMap<>();
                    obj.put("text", x.getText());
                    obj.put("value", x.name());
                    obj.put("index", x.ordinal());
                    return obj;

                }).collect(Collectors.toList());
    }
}
